#ifndef BTRACK_H
#define BTRACK_H

#include <iostream>
#include <vector>

#include <stdlib.h>
#include <time.h>

#include "Element.h"

#include "glee.h"

//#define DEBUG_TRACK 0
//#define VBO 0

class BallTrack
{
    public:

        BallTrack();
        virtual ~BallTrack();

        void readElements();
        void genTrack();
        void initVBO();
        void draw();
        void drawBlock(int idBlock, int idTrack);

        int getTab(int a);
        int getNbTracks();
        int getSize();

        inline const float getBlockLongueur() const {return blockLongueur;}
        inline const float getBlockLargeur() const {return blockLargeur;}

    private:

        std::vector<Element *> allElements;
        std::vector<Element *> track;

        GLuint vboBlock[2]; // [0]=data ; [1]=index

        int* tab;

        int size; // nombre de ligne
        int nbTracks; // nb colonne en fonction de element
        static const int nbElements = 16;

        static const float blockLargeur = 2.0;
        static const float blockLongueur = 4.0;
        static const float blockHauteur = 0.5;
};

#endif // TRACK_H
